package com.kh.statistics.video.base;

import java.util.List;
import java.util.stream.Collectors;

public interface ConverterBase<S, T> {

    T convert(S t);

    default List<T> batchConvert(List<S> sourceList) {
        if (null == sourceList || sourceList.isEmpty()) {
            return null;
        }
        return sourceList.stream().map(this::convert).collect(Collectors.toList());
    }

}
